package com.zrrd.mapper;

import com.zrrd.entity.Banner;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface BannerMapper {

    String SELECT_ALL = "SELECT B.ID, B.URL, B.SRC, B.WEIGHT, B.INFO, B.CREATE_TIME, B.LAST_MODIFY " +
            "FROM lesson.banner B ";

    /**
     * 全查询Banner记录并按权重升序
     *
     * @return 全部Banner记录
     */
    @Select(SELECT_ALL + "ORDER BY B.WEIGHT")
    @Options(timeout = 1000, useCache = false)
    List<Banner> list();
}
